<?php

namespace Largezhou\Admin\Widgets;

use Largezhou\Admin\Components\Component;

class Card extends Component
{
    protected $component = 'el-card';
    protected $header = '';
    protected $contents = [];

    public function __construct($content, $header = '')
    {
        $this->content($content);
        $this->header = $header;
    }

    public function content($content)
    {
        $this->contents[] = $content;
    }

    public function variables()
    {
        return [
            'component' => $this->component(),
            'props'     => [
                'header' => $this->header,
            ],
            'class'     => ['admin-card'],
            'contents'  => $this->contents,
        ];
    }
}
